package main.java.design.state;

/**
 * <p>
 *     状态模式
 * </p>
 *
 * @author : wangdejian
 * @version 1.0
 * @date : 2020/6/26 17:15
 */
public class Client {
    public static void main(String[] args) {
        GameContext gameContext = new GameContext();

        gameContext.setHeroState(new SpeedUpState());
        System.out.println("当前状态：" + gameContext.getHeroState().getClass().getSimpleName());
        gameContext.slowDown();
        System.out.println("当前状态：" + gameContext.getHeroState().getClass().getSimpleName());
        gameContext.vertigo();
        System.out.println("当前状态：" + gameContext.getHeroState().getClass().getSimpleName());
        gameContext.fear();
        System.out.println("当前状态：" + gameContext.getHeroState().getClass().getSimpleName());
    }
}
